import requests
url = "http://www.baidu.com"
response = requests.get(url)
# 方法一
## response.encoding ="utf-8"
## print(response.text)
print(url)
# 方法二
print(response.content.decode())
#方法三
res = response.content.decode("utf-8")
print(res)
with open("result.html","w",encoding="utf-8") as f:
    f.write(res)